feat(workhub): add typed action gate - #3818
Conversation
Generated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Update on b65c5c2313:
CODE NO-GO — 4×P2
- P2-1 correction without explicit intent fails
confirmation_requiredbefore Stop. - P2-2 dropping
replacewhen source outside bounded set silently forks while reporting corrected. - P2-3 concurrent replacements lack source lock → fan-out to different targets after Stop.
- P2-4
record48 KiB vs retry probe 32 KiB → retry after success hitscommit_outcome_unknown.
Fix: make correction carry explicit stop text or relax gate; keep replace mandatory or fail; add source lease across actions; align byte limits. Hosted test: SUCCESS does not waive these.
简体中文
四处权限/一致性阻塞。Generated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Update on 48666a0ceb:
CODE NO-GO — 3×P2
- P2 candidate path does not write
admitted.targetTurnIdto local map → natural-language correction cannot send replacement (fail-closed at 814). E2Eworkhub-reconstructionfails (32879372758). - P2 Stop-then-submit with swallowed replay leaves source stopped and target unconfirmed → retry gets
stop_not_owned. - P2 48 KiB user + 8 KiB assistant JSON record can exceed 72 KiB retry lookup after escaping → retry becomes
commit_outcome_unknown.
简体中文
存在路径阻塞与重放问题。Preserve Runtime-admitted root receipts for natural-language corrections and avoid deleting newer ownership after a concurrent Stop.\n\nGenerated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Update on f2785c5dc0:
CODE NO-GO — 2×P2 plus required check red
- P2 Stop-then-submit with swallowed replay leaves source stopped and target unconfirmed → retry
stop_not_owned. - P2 JSON record escaped bytes exceed 72 KiB retry lookup → retry
commit_outcome_unknown.
Note: natural-language correction P2 from prior head is now closed (gated receipt saved). Hosted test: FAILURE on format check (new test ternary).
简体中文
仍有两处阻塞,另需格式化修复。Generated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Update on 05d3d26e20:
CODE NO-GO — 2×P2 (carry-over, formatting fix only)
- P2 Stop-then-submit without replay on target failure → retry
stop_not_owned. - P2 JSON escaped record may exceed 72 KiB retry lookup →
commit_outcome_unknown.
Formatting failure from prior head fixed; logic unchanged. Hosted test: QUEUED — not green.
简体中文
仍有两处阻塞。Resume the exact target submission after a replacement Stop and budget summary replay reads for worst-case JSON escaping.\n\nGenerated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Update on 92d0947890:
[P2] #replacementRecoveries can exhaust to Host-wide outage
Capacity 256 is only released on Stop failure or target success. After Stop succeeds, permanent target rejections (e.g. session_busy) keep the recovery forever with no TTL/reaper — 256 failures exhaust replacements Host-wide as host_not_ready until restart.
Fix: give recoveries reconciled lifecycle / TTL for permanent failures.
Checks on 92d0947890d2aeec9a6363f17b68ff0850deb5b0 are test: SUCCESS — code is NO-GO.
简体中文
异常恢复容量会耗尽。Release recovery checkpoints after definitive target failures and expire uncertain outcomes after a bounded reconciliation window.\n\nGenerated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed this head and found no blocking issues.
Fixes replacement recovery lifecycle (typed failure releases checkpoint, unknown retains fingerprint with 5-min TTL) — closes prior 256-capacity outage; definitive/unknown regression tests pass. Hosted test: SUCCESS (32924223915).
No new P0-P3.
简体中文
该头无新增阻断。Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
Generated-by: Codex
3beac53 to
9532d2d
Compare
Generated-by: Codex
Summary
Implements Slice 4 from #3492 on top of the merged Slice 3 coordination-session work:
answer_here,delegate_existing,create_new, andclarify;create_newthe only WorkHub disposition that can create an ordinary Session;Safety and authority boundaries
Slice boundary: destructive correction is deferred to Slice 5
This PR intentionally does not expose
replaceorStopthrough the Slice 4 Action Gate.A destructive correction is not just another routing disposition: it must prove durable linkage between the original delegation, the exact root Turn that WorkHub owns, the correcting action, and the replacement submission. That linkage and the recovery contract around the non-atomic Stop-to-submit seam must survive Runtime Host restart. Those are Slice 5 responsibilities in #3492.
Keeping only Host-lifetime ownership maps, TTLs, or retry lanes in Slice 4 would make the behavior appear safe while losing its authorization and recovery basis after restart. The chosen boundary is therefore:
answer_here,clarify,delegate_existing, andcreate_neweffects.The protocol decoder is closed and rejects a
replacefield. The production Action Gate has no Stop effect. Desktop does not offer a correction control; if the routing policy recognizes a natural-language cross-Session correction, production fails closed before a second delegation and tells the user to open the original Session to stop the current work. The legacy R2.4 correction path remains test-only and is not used by the application.Verification
git diff --checkpassed for all affected filesCloses the Slice 4 implementation items in #3492. Persistent delegation linkage, natural-language correction, and Stop/cancel behavior remain Slice 5.
AI assistance: Codex helped implement and verify this change. The commits include the required
Generated-by: Codextrailer.